package cn.cena.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * 针对于全文检索映射
 * indexName：索引库
 * type：类型
 */
@Document(indexName = "hrm",type = "course")
@Data
public class CourseDoc {

    @Id
    private Long id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word") //分词
    private String name;

    @Field(type = FieldType.Keyword)
    private String forUser;

    private Long tenantId;

    @Field(type = FieldType.Keyword)
    private String gradeName;


    private Long courseTypeId;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word") //分词
    private String tenantName;

    @Field(type = FieldType.Keyword,index = false)
    private String pic;

    private Integer saleCount;

    private Integer viewCount;

    private Integer commentCount;

    private Date onlineTime;

    private Date expires;

    /**
     * 是否收费
     */
    private String chargeName;

    private Float price;

    private Float priceOld;


}
